<template>
  <div class="wrap">
    <div class="top">
      <div class="pledgee-name">
        <h1>撤回商标注销申请书</h1>
      </div>

      <div class="pledgee-msg">
        <div class="top-left">
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">申请人名称(中文) :</span>
              <el-input v-if="control" v-model="appNameCn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNameCn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-right">
              <span class="form-menu-text">(英文) :</span>
              <el-input v-if="control" v-model="appNameEn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNameEn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">申请人地址(中文) :</span>
              <el-input v-if="control" v-model=" appAddCn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appAddCn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-right">
              <span class="form-menu-text">(英文) :</span>
              <el-input v-if="control" v-model=" appAddEn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{ appAddEn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">邮政编码 :</span>
              <el-input v-if="control" v-model="postcode" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{postcode}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">联系人 :</span>
              <el-input v-if="control" v-model="contacts" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{contacts}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">邮箱 :</span>
              <el-input v-if="control" v-model="email" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{email}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">电话 :</span>
              <el-input v-if="control" v-model="phone" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{phone}}</span>
            </div>
          </div>

          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">商标注册号 :</span>
              <el-input v-if="control" v-model="appNum" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNum}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">原注销申请号 :</span>
              <el-input v-if="control" v-model="oldApplicationNum" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{oldApplicationNum}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">代理机构名称 :</span>
              <el-input v-if="control" v-model="oldApplicationNum" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{ ageName }}</span>
            </div>
          </div>

          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">是否共有商标 :</span>
              <div v-if="control" style="width:100%;padding-left:30px">
                <el-radio v-model="isComm" label="1">是</el-radio>
                <el-radio v-model="isComm" label="0">否</el-radio>
              </div>
              <span class="parallelism" v-else>
                <span v-if="isComm == 1">是</span>
                <span v-else>否</span>
                <!-- <el-radio v-model="isComm" label="1" :disabled="isComm==0?true:false">是</el-radio>
                <el-radio v-model="isComm" label="0" :disabled="isComm==1?true:false">否</el-radio>-->
              </span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text" style="height:100%">撤回理由 :</span>
              <el-input
                v-if="control"
                type="textarea"
                show-word-limit
                maxlength="100"
                :rows="1"
                placeholder="请输入内容"
                v-model=" reasonsWithdrawal"
              ></el-input>
              <span class="parallelism" v-else>{{ reasonsWithdrawal}}</span>
            </div>
          </div>

          <!-- 营业执照 -->
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">营业执照 :</span>
              <span class="parallelism">
                <imgshow>
                  <img class="busImg" :src="this.mconfig.host+busimg" alt />
                </imgshow>
              </span>
            </div>
          </div>

          <!-- 身份证 -->
          <!-- appliType -->
          <div class="form-menu" v-if="appliType==1">
            <div class="form-menu-left">
              <span class="form-menu-text">身份证 :</span>
              <span class="parallelism">
                <imgshow>
                  <img class="idCardImg" :src="this.mconfig.host+idcardimg" alt />
                </imgshow>
              </span>
            </div>
          </div>

          <!-- 网上确认书 -->
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">网上确认书 :</span>
              <span class="parallelism">
                <imgshow>
                  <img class="busImg" :src="this.mconfig.host+qrfile" alt />
                </imgshow>
              </span>
            </div>
          </div>
          <!-- 其他附件 -->
          <div >
            <div class="form-menu">
              <div class="form-menu-left" v-if="qtfujian.length != 0">
                <span class="form-menu-text">其他附件 :</span>
                <span class="parallelism">
                  <imgshow v-for="(item,index) in qtfujian" :key="index">
                    <img class="busImg" :src="mconfig.host+item" alt />
                  </imgshow>
                </span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="follower" v-if="isComm==1? true:false" style="margin-top:30px">
      <div class="follower-title">
        <div>
          <h2>撤回商标注销申请书</h2>
          <h2 class="fuye">（附页）</h2>
        </div>
        <span class="follower-title-text">其他共有许可人</span>
      </div>
      <proAppend class="style17" :callback="proAppendJson"></proAppend>
    </div>
  </div>
</template>

<script>
import imgshow from "../common/imgshow";
import proAppend from "../common/proAppend";
export default {
  components: {
    imgshow,
    proAppend,
  },
  data() {
    return {
      ageName: "", //  代理机构名称
      appAddCn: "", //   申请人地址（中文）
      appAddEn: "", //   申请人地址（英文）
      appNameCn: "", //   申请人名称（中文）
      appNameEn: "", //   申请人名称（英文）
      appNum: "", //   商标注册号
      applicantType: "", //   申请人类型
      beforeApplicantNum: "", //   原续展申请号
      branchNetworkId: "", //   网点编号
      cancelled: "", //   注销商品/服务项目
      contacts: "", //   联系人
      email: "", // 邮箱
      id: "",
      isComm: "0", //   是否共有商标
      oldApplicationNum: "", //   原注销申请号
      phone: "", //   电话
      postcode: "", //   邮政编码
      proAppendJson: [], //   共享人json
      reason: "", //   没有交回原注册文件里有
      reasonsWithdrawal: "", //   撤回理由
      subStatus: "", //   状态
      userId: "", //   用户ID
      wotcaType: "", //   类别
      idcardimg: "", //身份证正面
      qrfile: "", //网上确认书
      busimg: "", //营业执照
      appliType: "", //是否存在身份证
      qtfujian: [], //其他附件
      control: false, //   控制标签的显示
      options: [
        { value: 0, label: "企业" },
        { value: 1, label: "个人" },
      ],
      optionss: [
        { value: 1, label: "保存" },
        { value: 2, label: "通过" },
        { value: 3, label: "未通过" },
        { value: 4, label: "未审核" },
      ],
      dialogVisible: false,
      disabledd: false,

      applicantTypee: "", //   申请类型(页面展示)
      isComms: "", //   是否共有商标的文本部分(页面展示)
      subStatuss: "", //   状态(页面展示)
    };
  },
  methods: {
    appLenFn() {
      var appLen = 0;
      this.append.forEach((item) => {
        for (const key in item) {
          if (item[key] !== "") {
            appLen += 1;
            // console.log(appLen);
          }
        }
      });
      if (appLen == 0) {
        return false;
      } else {
        return true;
      }
    },
    genre() {
      ////console.log(this.appliType)
    },
    notarizeAmend() {
      if (this.control) {
        this.control = false;
        ////console.log(this.control)
      } else {
        this.control = true;
        ////console.log(this.control)
      }
    },
    handleExceed(files, fileList) {
      //   图片地址
      this.disabledd = true;
      let a = "http://api_devs.wanxikeji.cn/" + files.data;
      this.imgPath.push(a);
      // ////console.log(this.imgPath)
    },
    handlePictureCardPreview(file) {
      //  上传图片的放大显示
      this.imgPath = file.url;
      this.dialogVisible = true;
      //  ////console.log('www',file)
    },
    handleRemove(file) {
      //  上传图片的删除
      ////console.log(file);
      this.disabledd = false;
      this.$refs.upload.clearFiles();
    },
    add(val) {
      this.$http
        .get("/trademark/proWotca/findByIdDetl", {
          params: {
            id: val,
          },
        })
        .then((res) => {
          // console.log(res);
          this.appNameCn = res.data.data.data.appName; //   申请人名称（中文）
          this.appNameEn = res.data.data.data.appNameEn; //   申请人名称（英文）
          this.appAddCn = res.data.data.data.busAddress; //   申请人地址（中文）
          this.appAddEn = res.data.data.data.appAddEn; //   申请人地址（英文）
          this.postcode = res.data.data.data.postCode; //  邮政编码
          this.contacts = res.data.data.data.contacts; //  联系人
          this.email = res.data.data.data.email; //邮箱
          this.phone = res.data.data.data.phone; //  电话
          this.ageName = res.data.data.data.deptName; //  代理机构
          this.appNum = res.data.data.data.registNum; //  商标注册号
          this.oldApplicationNum = res.data.data.data.oldApplicationNum; //  撤回商标注销申请
          this.isComm = String(res.data.data.data.share); //  是否共有商标
          this.reasonsWithdrawal = res.data.data.data.reasonsWithdrawal; //  撤回理由
          this.idcardimg = res.data.data.data.idcardimg; //身份证正面
          this.qrfile = res.data.data.data.qrfile; //网上确认书
          this.busimg = res.data.data.data.busimg; //营业执照
          this.appliType = res.data.data.data.appliType; //是否存在身份证
          this.proAppendJson = res.data.data.append; //   共有人
          console.log(res.data.data.data.otherfile);
          if (res.data.data.data.otherfile) {
            this.qtfujian = JSON.parse(res.data.data.data.otherfile);
          } else {
            this.qtfujian = [];
          }
        });
    },
  },
  watch: {
    control(val) {
      if (val) {
      } else {
        if (this.applicantType == 0) {
          this.applicantTypee = "企业";
        } else if (this.applicantType == 1) {
          this.applicantTypee = "个人";
        }

        if (this.isComm == 1) {
          this.isComms = "是";
        } else if (this.isComm) {
          this.isComms = "否";
        }

        if (this.subStatus == 1) {
          this.subStatuss = "保存";
        } else if (this.subStatus == 2) {
          this.subStatuss = "通过";
        } else if (this.subStatus == 3) {
          this.subStatuss = "未通过";
        } else if (this.subStatus == 4) {
          this.subStatuss = "未审核";
        }
      }
      ////console.log(this.applicantType,this.isComm,this.subStatus)
    },
  },
  mounted() {
    console.log(this.qtfujian, "//////////");
    let aa = this.$route.query.id;
    this.add(aa);
  },
};
</script>


<style scoped>
body,
div,
a,
p,
span,
ul,
li {
  padding: 0;
  margin: 0;
}
div {
  box-sizing: border-box;
}
.style17 {
  margin-left: 220px;
}
img {
  max-width: 100%;
  max-height: 100%;
}
a {
  text-decoration: none;
}
.wrap {
  position: relative;
}
.amend-btn {
  position: absolute;
  top: 8%;
  right: 10%;
}
.buttona {
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  background: rgba(0, 0, 255, 0.5);
}
.buttona:hover {
  background: rgba(0, 0, 255, 0.8);
}

.pledgee-name {
  width: 100%;
  padding-left: 280px;
  margin: 20px 0 0 0px;
  font-size: 25px;
}
h1 {
  font-weight: 500;
  font-size: 25px;
}
h2 {
  font-size: 20px;
}
.dashed-text {
  /* 质权人信息部分的标题  */
  font-size: 17px;
  font-weight: bold;
  color: rgb(100, 100, 100);
}
.dashed {
  /* 质权人信息部分的内容  */
  width: 50%;
  margin-left: 10px;
  border-top: 1px dashed rgb(204, 204, 204);
}
.pledgee-msg {
  padding-left: 188px;
}
.pledgee-name > h1 {
  line-height: 50px;
  padding-bottom: 20px;
  font-size: 25px;
}
.top-left {
  /* 内容的左边部分  */
  width: 800px;
  /* border: 1px solid red; */
}
.form-menu {
  /*  每行内容的显示  */
  display: flex;
  flex-direction: row;

  /* border: 1px solid red; */
}
.form-menu-left {
  width: 100%;
  display: flex;
  line-height: 28px;
  flex-direction: row;
}
.form-menu-right {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
}
.form-menu-text {
  /*  每行内容文本的css样式的显示  */
  width: 320px;
  font-size: 14px;
  text-align: right;
  margin-right: 12px;
  line-height: 28px;
  /* padding-top: 10px; */
  color: #606266;
  /* border: 1px solid red; */
}
.parallelism {
  width: 100%;
  line-height: 28px;
  /* padding: 10.2px 0; */
}
.el-input /deep/ .el-input__inner {
  color: #000;
  height: 38px;
}

.el-select {
  width: 700px;
}
.el-select-dropdown__item {
  padding-left: 20px;
}

/* 新版本样式 */
.stamp {
  width: 30%;
  height: 220px;
  font-size: 15px;
  text-align: center;
  /* border: 1px solid red; */
}
.agent {
  width: 100%;
  text-align: right;
  margin-right: 40%;
  margin-top: 60px;
}
.follower-title {
  margin-left: 280px;
  font-size: 25px;
}
.follower-title-text {
  font-size: 14px;
  font-weight: normal;
  display: inline-block;
  padding: 10px 0 15px 0;
  margin-left: 46px;
}
.follower-matter-frame {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 1000px;
  padding: 25px 0 0 0;
  margin-left: 46px;
}
.seal {
  color: #ccc;
}
.follower-matter-text {
  padding-left: 23px;
  display: flex;
  justify-content: flex-start;
  font-size: 15px;
  text-align: right;
  line-height: 28px;
}
.fuye {
  margin-left: 50px;
}

.idCardImg {
  width: 350px;
  margin: 5px;
}
.busImg {
  width: 500px;
  margin: 5px;
}
.displayNone {
  display: none;
}
</style>